home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -websites- / wirenet / files / fixmdgroups.lha / FixMDgroups
Text File  |  1998-12-16  |  907b  |  38 lines

  1. /* */
  2.  
  3. options results
  4.  
  5. if ~show('L','rexxsupport.library') then do
  6.   if ~addlib('rexxsupport.library',0,-30) then call ExitMsg('Failed to open rexxsupport.library')
  7.   end
  8.  
  9. groupfile = 'NetConnect2:Programs/MicroDot-II/Data/Grouplist'
  10. tempfile = 'NetConnect2:Programs/MicroDot-II/Data/FixMDGroups.'time(s)
  11.  
  12. if ~open(in,groupfile,'R') then call ExitMsg('Failed to open' groupfile)
  13. if ~open(out,tempfile,'W') then call ExitMsg('Failed to create temporary group file')
  14.  
  15. do until eof(in)
  16.     group = readln(in)
  17.     if group = '' then iterate
  18.     call writeln(out,trim(group)'   ')
  19.     end
  20.  
  21. call close(in)
  22. call close(out)
  23.  
  24. address command
  25. if ~rename(groupfile,groupfile'.old') then call ExitMsg('File rename failure')
  26. if ~rename(tempfile,groupfile) then call ExitMsg('File rename failure')
  27. call delete(tempfile)
  28. call delete(groupfile'.old')
  29. exit
  30.  
  31. ExitMsg:
  32.     parse arg msg
  33.     say
  34.     say msg
  35.     say
  36.     exit
  37.  
  38.